package com.zxx.pattern.iteratorPattern.iterator2.old;

import java.net.FileNameMap;
import java.util.List;

/**
 * 访问太麻烦：所以许要迭代器 进行统一
 * @author zxx on 2021/4/8
 */
public class TestOld {

    public static void main(String[] args) {
        TVChanneMenu tvChanneMenu = new TVChanneMenu();
        List<MenuItem> itemList = tvChanneMenu.getMenuItems();
        for (int i = 0; i < itemList.size(); i++) {
            MenuItem item = itemList.get(i);
            System.out.println(item.name);
        }

        FilmMenu filmMenu = new FilmMenu();
        MenuItem[] items = filmMenu.getMenuItems();
        for (int i = 0; i < items.length; i++) {
            MenuItem item = items[i];
            System.out.println(item.name);
        }
    }

}
